import React, { Component, createRef } from 'react'

import Child from './Child'
export default class UNControllerd extends Component {
  constructor() {
    super()
    this.inputRef = createRef()
  }
  render() {
    return (
      <div>
        <h2>UNControllerd</h2>

        <Child ref={this.inputRef} />
        <input
          type="button"
          value="button"
          onClick={() => this.hanldeGetValue()}
        />
      </div>
    )
  }

  hanldeGetValue() {
    console.log(this.inputRef.current.value)
  }
}
